﻿using Microsoft.Expression.Encoder.Devices;
using Microsoft.Expression.Encoder.Live;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace PlayCardCapture
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SingleCapture s = new SingleCapture();
            s.Show();
            this.Hide();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DualCapture d = new DualCapture();
            d.Show();
            this.Hide();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            LiveJob job = new LiveJob();
            EncoderDevice video = EncoderDevices.FindDevices(EncoderDeviceType.Video).ElementAt(0);
            EncoderDevice audio = EncoderDevices.FindDevices(EncoderDeviceType.Audio).ElementAt(0);
            LiveDeviceSource source = job.AddDeviceSource(video, audio);
            source.ShowConfigurationDialog(ConfigurationDialog.VideoCaptureDialog, (new HandleRef(this, this.Handle)));
            job.Dispose();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            LiveJob job = new LiveJob();
            EncoderDevice video = EncoderDevices.FindDevices(EncoderDeviceType.Video).ElementAt(1);
            EncoderDevice audio = EncoderDevices.FindDevices(EncoderDeviceType.Audio).ElementAt(0);
            LiveDeviceSource source = job.AddDeviceSource(video, audio);
            source.ShowConfigurationDialog(ConfigurationDialog.VideoCaptureDialog, (new HandleRef(this, this.Handle)));
            job.Dispose();
        }
    }
}
